package cn.me.controller;

import cn.me.pojo.Section;
import cn.me.service.SectionService;
import cn.me.service.impl.SectionServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/*部门的控制层*/
@Controller
@RequestMapping("/sectionType")
public class SectionController {
    @Autowired
    private SectionService service;
    //动态分页
    @RequestMapping("all")
    public String all(Model model){
        List<Section> sections = service.selectAll();
        model.addAttribute("section",sections);
        return "sectionList";
    }

}
